package xs.com.mylibrary.base.quick;

import android.content.Context;

import xs.com.mylibrary.allinone.RequestUtils;
import xs.com.mylibrary.allinone.util.LogUtils;
import xs.com.mylibrary.allinone.volley.Request;
import xs.com.mylibrary.base.PageThreadhandler;


public abstract class QuickThreadHandler<T, S, E> extends PageThreadhandler<QuickRequestBean, S, E> {

    protected Context mContext;


    public QuickThreadHandler(Context context) {
        super(context);
        this.mContext = context;
    }

    @Override
    protected void handlePageHttp(QuickRequestBean bean) {

        LogUtils.d(bean.getUrl());
        Request<T> request = getRequest(bean);
        request.setTag(mContext);
        RequestUtils.init(mContext);
        RequestUtils.addRequsetQueue(request, mContext);
    }

    protected abstract Request<T> getRequest(QuickRequestBean bean);


}
